﻿using System;
using System.Collections.Generic;
using System.IO;
using JamesZhao.Engine.Graphics.Geometry;
using JamesZhao.Engine.Loaders;

namespace JamesZhao.Engine
{
    internal class ResourceManager
    {
        private const string ContentPath = @"data/";

        //extension -> mesh loader

        public ResourceManager()
        {
            MeshLoaders = new Dictionary<string, MeshLoader>();
            SetupMeshLoaders();
        }

        private IDictionary<string, MeshLoader> MeshLoaders { get; set; }

        private void SetupMeshLoaders()
        {
        }

        public MeshData LoadModel(string name)
        {
            string extension = new FileInfo(name).Extension;
            if (MeshLoaders.ContainsKey(extension))
                return MeshLoaders[extension].LoadModel(name);

            throw new NotImplementedException("Can't load model of type " + extension);
        }

        public void LoadTexture(string name)
        {
            throw new NotImplementedException();
        }
    }
}